home *** CD-ROM | disk | FTP | other *** search
/ Pro One: Netcracker Netscape Navigator / ProOne: Netcracker Netscape Navigator.iso / pc / nc / nct07005.geo / 00262_SnakeLogic.ls < prev    next >
Encoding:
Text File  |  1997-03-19  |  7.2 KB  |  396 lines

  1. on InitSnakelogic
  2.   Set_SnakeSprite(3)
  3.   Set_HLSprite(4)
  4.   Set_TagSprite(40)
  5.   Set_TagIsShown(0)
  6.   Set_LastTag(0)
  7.   set the puppet of sprite Get_TagSprite() to 1
  8.   CreateSnakeGrid()
  9. end
  10.  
  11. on CreateSnakeGrid
  12.   Set_BoxSize(14)
  13.   SetGridRef()
  14. end
  15.  
  16. on CheckSnakeStatus
  17.   if rollOver(Get_SnakeSprite()) then
  18.     ShowTag()
  19.   else
  20.     if get_TagIsShown() then
  21.       HideTag()
  22.     end if
  23.   end if
  24. end
  25.  
  26. on RestoreHilites
  27.   set theVec to Get_SeenINPath()
  28.   repeat with i = 1 to the number of items in theVec
  29.     if item i of theVec = 1 then
  30.       set NumOfBox to i
  31.       set tagVLoc to ((NumOfBox - 1) * get_BoxSize()) + get_GridRef(2)
  32.       set the locH of sprite Get_HLSprite() to integer(get_GridRef(1))
  33.       set the locV of sprite Get_HLSprite() to integer(tagVLoc)
  34.       updateStage()
  35.     end if
  36.   end repeat
  37. end
  38.  
  39. on ChooseScreen
  40.   sound stop 2
  41.   set themouseV to the mouseV
  42.   set NumOfBox to integer(((themouseV - get_GridRef(2)) / get_BoxSize()) - 0.5) + 1
  43.   set movieName to item NumOfBox of Get_CurrentSnakeScreens()
  44.   if the number of chars in movieName = 8 then
  45.     set tagVLoc to ((NumOfBox - 1) * get_BoxSize()) + get_GridRef(2)
  46.     SaveHilite(NumOfBox)
  47.     go("INIT" & Get_ScreenSubject(), movieName & ".GEO")
  48.   end if
  49. end
  50.  
  51. on SaveHilite NumOfBox
  52.   Set_SeenINPath(1, Get_CDcounter())
  53. end
  54.  
  55. on ShowTag
  56.   set themouseV to the mouseV
  57.   set NumOfBox to integer(((themouseV - get_GridRef(2)) / get_BoxSize()) - 0.5) + 1
  58.   if get_LastTag() <> NumOfBox then
  59.     Set_LastTag(NumOfBox)
  60.     set tagVLoc to ((NumOfBox - 1) * get_BoxSize()) + get_GridRef(2) + integer(get_BoxSize() / 2)
  61.     set the castNum of sprite Get_TagSprite() to the number of cast ("tag-" & NumOfBox)
  62.     set the locH of sprite Get_TagSprite() to integer(get_GridRef(1)) - 3
  63.     set the locV of sprite Get_TagSprite() to integer(tagVLoc)
  64.     updateStage()
  65.     Set_TagIsShown(1)
  66.   end if
  67. end
  68.  
  69. on HideTag
  70.   Set_TagIsShown(0)
  71.   Set_LastTag(0)
  72.   set the locH of sprite Get_TagSprite() to 999
  73.   set the locV of sprite Get_TagSprite() to 999
  74.   updateStage()
  75. end
  76.  
  77. on SetGridRef
  78.   global GridRef
  79.   put the locH of sprite Get_SnakeSprite() into item 1 of GridRef
  80.   put the locV of sprite Get_SnakeSprite() into item 2 of GridRef
  81. end
  82.  
  83. on get_GridRef theItem
  84.   global GridRef
  85.   return item theItem of GridRef
  86. end
  87.  
  88. on Set_TagIsShown theSp
  89.   global TagIsShown
  90.   set TagIsShown to theSp
  91. end
  92.  
  93. on get_TagIsShown
  94.   global TagIsShown
  95.   return TagIsShown
  96. end
  97.  
  98. on Set_LastTag theSp
  99.   global LastTag
  100.   set LastTag to theSp
  101. end
  102.  
  103. on get_LastTag
  104.   global LastTag
  105.   return LastTag
  106. end
  107.  
  108. on Set_BoxSize theSp
  109.   global BoxSize
  110.   set BoxSize to theSp
  111. end
  112.  
  113. on get_BoxSize
  114.   global BoxSize
  115.   return BoxSize
  116. end
  117.  
  118. on Set_SnakeSprite theSp
  119.   global SnakeSprite
  120.   set SnakeSprite to theSp
  121. end
  122.  
  123. on Get_SnakeSprite
  124.   global SnakeSprite
  125.   return SnakeSprite
  126. end
  127.  
  128. on Set_HLSprite theSp
  129.   global HLSprite
  130.   set HLSprite to theSp
  131. end
  132.  
  133. on Get_HLSprite
  134.   global HLSprite
  135.   return HLSprite
  136. end
  137.  
  138. on Set_TagSprite theSp
  139.   global TagSprite
  140.   set TagSprite to theSp
  141. end
  142.  
  143. on Get_TagSprite
  144.   global TagSprite
  145.   return TagSprite
  146. end
  147.  
  148. on Set_CDcounter theNum
  149.   global CDcounter
  150.   set CDcounter to theNum
  151. end
  152.  
  153. on Add_CDcounter theNum
  154.   global CDcounter
  155.   set CDcounter to theNum + CDcounter
  156. end
  157.  
  158. on Get_CDcounter
  159.   global CDcounter
  160.   return CDcounter
  161. end
  162.  
  163. on Set_SeenINPath theNum, theItem
  164.   global SEENINPath
  165.   if paramCount() = 2 then
  166.     put theNum into item theItem of SEENINPath
  167.   else
  168.     set SEENINPath to theNum
  169.   end if
  170. end
  171.  
  172. on Get_SeenINPath theItem
  173.   global SEENINPath
  174.   if paramCount() = 1 then
  175.     return item theItem of SEENINPath
  176.   else
  177.     return SEENINPath
  178.   end if
  179. end
  180.  
  181. on SaveSeenScreens
  182.   SaveHilite()
  183.   set toolNum to Get_CurrentTool()
  184.   do("Set_WasInPathTool" & toolNum)
  185. end
  186.  
  187. on Set_ScreensTool01 theMode
  188.   global ScreensTool01
  189.   set ScreensTool01 to theMode
  190. end
  191.  
  192. on Get_ScreensTool01
  193.   global ScreensTool01
  194.   return ScreensTool01
  195. end
  196.  
  197. on Set_ScreensTool02 theMode
  198.   global ScreensTool02
  199.   set ScreensTool02 to theMode
  200. end
  201.  
  202. on Get_ScreensTool02
  203.   global ScreensTool02
  204.   return ScreensTool02
  205. end
  206.  
  207. on Set_ScreensTool03 theMode
  208.   global ScreensTool03
  209.   set ScreensTool03 to theMode
  210. end
  211.  
  212. on Get_ScreensTool03
  213.   global ScreensTool03
  214.   return ScreensTool03
  215. end
  216.  
  217. on Set_ScreensTool04 theMode
  218.   global ScreensTool04
  219.   set ScreensTool04 to theMode
  220. end
  221.  
  222. on Get_ScreensTool04
  223.   global ScreensTool04
  224.   return ScreensTool04
  225. end
  226.  
  227. on Set_ScreensTool05 theMode
  228.   global ScreensTool05
  229.   set ScreensTool05 to theMode
  230. end
  231.  
  232. on Get_ScreensTool05
  233.   global ScreensTool05
  234.   return ScreensTool05
  235. end
  236.  
  237. on Set_ScreensTool06 theMode
  238.   global ScreensTool06
  239.   set ScreensTool06 to theMode
  240. end
  241.  
  242. on Get_ScreensTool06
  243.   global ScreensTool06
  244.   return ScreensTool06
  245. end
  246.  
  247. on Set_WasInPathTool01 theMode
  248.   global WasInPathTool01
  249.   set WasInPathTool01 to Get_SeenINPath()
  250. end
  251.  
  252. on Get_WasInPathTool01
  253.   global WasInPathTool01
  254.   return WasInPathTool01
  255. end
  256.  
  257. on Set_WasInPathTool02 theMode
  258.   global WasInPathTool02
  259.   set WasInPathTool02 to Get_SeenINPath()
  260. end
  261.  
  262. on Get_WasInPathTool02
  263.   global WasInPathTool02
  264.   return WasInPathTool02
  265. end
  266.  
  267. on Set_WasInPathTool03 theMode
  268.   global WasInPathTool03
  269.   set WasInPathTool03 to Get_SeenINPath()
  270. end
  271.  
  272. on Get_WasInPathTool03
  273.   global WasInPathTool03
  274.   return WasInPathTool03
  275. end
  276.  
  277. on Set_WasInPathTool04 theMode
  278.   global WasInPathTool04
  279.   set WasInPathTool04 to Get_SeenINPath()
  280. end
  281.  
  282. on Get_WasInPathTool04
  283.   global WasInPathTool04
  284.   return WasInPathTool04
  285. end
  286.  
  287. on Set_WasInPathTool05 theMode
  288.   global WasInPathTool05
  289.   set WasInPathTool015 to Get_SeenINPath()
  290. end
  291.  
  292. on Get_WasInPathTool05
  293.   global WasInPathTool05
  294.   return WasInPathTool05
  295. end
  296.  
  297. on Set_WasInPathTool06 theMode
  298.   global WasInPathTool06
  299.   set WasInPathTool06 to Get_SeenINPath()
  300. end
  301.  
  302. on Get_WasInPathTool06
  303.   global WasInPathTool06
  304.   return WasInPathTool06
  305. end
  306.  
  307. on Set_WasInPathTool07 theMode
  308.   global WasInPathTool07
  309.   set WasInPathTool07 to Get_SeenINPath()
  310. end
  311.  
  312. on Get_WasInPathTool07
  313.   global WasInPathTool07
  314.   return WasInPathTool07
  315. end
  316.  
  317. on Set_WasInPathTool08 theMode
  318.   global WasInPathTool08
  319.   set WasInPathTool08 to Get_SeenINPath()
  320. end
  321.  
  322. on Get_WasInPathTool08
  323.   global WasInPathTool08
  324.   return WasInPathTool08
  325. end
  326.  
  327. on Set_WasInPathTool09 theMode
  328.   global WasInPathTool09
  329.   set WasInPathTool09 to Get_SeenINPath()
  330. end
  331.  
  332. on Get_WasInPathTool09
  333.   global WasInPathTool09
  334.   return WasInPathTool09
  335. end
  336.  
  337. on Set_WasInPathTool10 theMode
  338.   global WasInPathTool10
  339.   set WasInPathTool10 to Get_SeenINPath()
  340. end
  341.  
  342. on Get_WasInPathTool10
  343.   global WasInPathTool10
  344.   return WasInPathTool10
  345. end
  346.  
  347. on Set_WasInPathTool11 theMode
  348.   global WasInPathTool11
  349.   set WasInPathTool11 to Get_SeenINPath()
  350. end
  351.  
  352. on Get_WasInPathTool11
  353.   global WasInPathTool11
  354.   return WasInPathTool11
  355. end
  356.  
  357. on Set_WasInPathTool12 theMode
  358.   global WasInPathTool12
  359.   set WasInPathTool12 to Get_SeenINPath()
  360. end
  361.  
  362. on Get_WasInPathTool12
  363.   global WasInPathTool12
  364.   return WasInPathTool12
  365. end
  366.  
  367. on Set_WasInPathTool13 theMode
  368.   global WasInPathTool13
  369.   set WasInPathTool13 to Get_SeenINPath()
  370. end
  371.  
  372. on Get_WasInPathTool13
  373.   global WasInPathTool13
  374.   return WasInPathTool13
  375. end
  376.  
  377. on Set_CurrentTool theMode
  378.   global CurrentTool
  379.   set CurrentTool to theMode
  380. end
  381.  
  382. on Get_CurrentTool
  383.   global CurrentTool
  384.   return CurrentTool
  385. end
  386.  
  387. on Set_CurrentSnakeScreens theMode
  388.   global CurrentSnakeScreens
  389.   set CurrentSnakeScreens to theMode
  390. end
  391.  
  392. on Get_CurrentSnakeScreens
  393.   global CurrentSnakeScreens
  394.   return CurrentSnakeScreens
  395. end
  396.